package com.example.netty.service.hycyw;

import com.example.netty.common.FluxQuery;
import com.example.netty.pojo.Hycyw;
import com.influxdb.client.InfluxDBClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class HycywServiceImpl {
    @Autowired
    InfluxDBClient influxDBClient;

    public Hycyw findOne(String bucketName){
        return FluxQuery.newFindOne(influxDBClient,bucketName,"-24h","Hycyw",Hycyw.class);
    }

    public Hycyw findOneData(String bucketName,String time) throws Exception {
        return FluxQuery.findOneData(influxDBClient,bucketName,time,"Hycyw",Hycyw.class);
    }
}
